package service.impl;

import moder.User;
import service.UserService;

public class UserServiceImpl implements UserService {
    dao.UserDao dao = new dao.impl.UserDaoImpl();
    @Override
    public User getUserByLoginId(String loginid, String loginpassword) {
        User user = null;
        User currentUser = dao.getUserByLoginId(loginid);
        if(currentUser!=null){
            if(currentUser.getUpassword().equals(loginpassword)) {
                user = currentUser;
            }
        }
        return user;
    }
    @Override
    public void addInformation(String uid, String uname, String utelephone, String ubirthday, String usex) {
        dao.addInformation(uid, uname, utelephone, ubirthday, usex);
    }

}
